//
//  KoiAccountingBaseViewModel.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 16.03.25.
//

import Foundation
class KoiAccountingBaseViewModel: ObservableObject {
    
}

extension KoiAccountingBaseViewModel {
    
    var uid: String {
        return KoiAccountingUserManager.standard.userId()
    }
    
    var bookId: String {
        return BookManager.standard.currentBookId()
    }
}

extension KoiAccountingBaseViewModel {
    
    func asyncBackground(block: @escaping ()->Void) {
        DispatchQueue.global(qos: .background).async {
            block()
        }
    }
    
    func asyncMain(block: @escaping ()->Void) {
        DispatchQueue.main.async {
            block()
        }
    }
}
